package com.zaiteng;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;
import java.util.Map;

import anywheresoftware.b4a.AbsObjectWrapper;
import anywheresoftware.b4a.BA.ShortName;
import cn.jpush.im.android.api.content.MessageContent;
import cn.jpush.im.android.api.enums.ContentType;
import cn.jpush.im.android.api.enums.ConversationType;
import cn.jpush.im.android.api.model.Conversation;
import cn.jpush.im.android.api.model.Message;

@ShortName("Conversation_im")
public class ConversationWrapper extends AbsObjectWrapper<Conversation>{
	private Conversation conversation;

	public void Initialize(Conversation con1) {
		
		this.conversation = con1;
	}

	public Conversation getConversation() {
		return this.conversation;
	}

	public void setConversation(Conversation conversation) {
		this.conversation = conversation;
	}

	public String getId() {
		return this.conversation.getId();
	}

	public ConversationType getType() {
		return this.conversation.getType();
	}

	public String getTargetId() {
		return this.conversation.getTargetId();
	}

	public String getTargetAppKey() {
		return this.conversation.getTargetAppKey();
	}

	public String getLatestText() {
		return this.conversation.getLatestText();
	}

	public long getLastMsgDate() {
		return this.conversation.getLastMsgDate();
	}

	public ContentType getLatestType() {
		return this.conversation.getLatestType();
	}

	public int getUnReadMsgCnt() {
		return this.conversation.getUnReadMsgCnt();
	}

	public String getTitle() {
		return this.conversation.getTitle();
	}

	public File getAvatarFile() {
		return this.conversation.getAvatarFile();
	}

	public Message getLatestMessage() {
		return this.conversation.getLatestMessage();
	}

	public Object getTargetInfo() {
		return this.conversation.getTargetInfo();
	}
//
//	public Conversation createConversation(ConversationType arg0, long arg1){
//		return this.conversation.createConversation(ConversationType arg0, long arg1);
//	}
//
//	public Conversation createConversation(ConversationType arg0, String arg1){
//		return this.conversation.createConversation(ConversationType arg0, String arg1);
//	}
//
//	public Conversation createGroupConversation(long arg0){
//		return this.conversation.createGroupConversation(long arg0);
//	}
//
//	public Conversation createSingleConversation(String arg0){
//		return this.conversation.createSingleConversation(String arg0);
//	}
//
//	public Conversation createSingleConversation(String arg0, String arg1){
//		return this.conversation.createSingleConversation(String arg0, String arg1);
//	}

	public boolean resetUnreadCount(){
		return this.conversation.resetUnreadCount();
	}

	public Message getMessage(int idx) {
		return this.conversation.getMessage(idx);
	}

	public List getAllMessage() {
		return this.conversation.getAllMessage();
	}

//	public List getMessagesFromOldest() {
//		return this.conversation.getMessagesFromOldest(arg0, arg1)();
//	}

	public List getMessagesFromNewest() {
		return this.conversation.getMessagesFromNewest(0, 0);
	}

	public boolean deleteMessage(int arg0){
		return this.conversation.deleteMessage(arg0);
	}

	public boolean deleteAllMessage(){
		return this.conversation.deleteAllMessage();
	}

	public boolean updateMessageExtra(Message arg0, String arg1, String arg2){
		return this.conversation.updateMessageExtra(arg0, arg1, arg2);
	}

	public boolean updateMessageExtra(Message arg0, String arg1, Number arg2){
		return this.conversation.updateMessageExtra(arg0, arg1, arg2);
	}

	public boolean updateMessageExtra(Message arg0, String arg1, Boolean arg2){
		return this.conversation.updateMessageExtra(arg0, arg1, arg2);
	}

	public boolean updateMessageExtras(Message arg0, Map arg1){
		return this.conversation.updateMessageExtras(arg0, arg1);
	}

	public Message createSendMessage(MessageContent arg0){
		return this.conversation.createSendMessage(arg0);
	}

	public Message createSendMessage(MessageContent arg0, String arg1){
		return this.conversation.createSendMessage(arg0, arg1);
	}

	public Message createSendTextMessage(String arg0){
		return this.conversation.createSendTextMessage(arg0);
	}

	public Message createSendTextMessage(String arg0, String arg1){
		return this.conversation.createSendTextMessage(arg0, arg1);
	}

	public Message createSendImageMessage(String arg0){
		try {
			return this.conversation.createSendImageMessage(new File(arg0));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null; 
		}
	}
//
//	public Message createSendImageMessage(File arg0, String arg1){
//		return this.conversation.createSendImageMessage(File arg0, String arg1);
//	}
//
//	public Message createSendVoiceMessage(File arg0, int arg1){
//		return this.conversation.createSendVoiceMessage(File arg0, int arg1);
//	}
//
//	public Message createSendVoiceMessage(File arg0, int arg1, String arg2){
//		return this.conversation.createSendVoiceMessage(File arg0, int arg1, String arg2);
//	}
//
//	public Message createSendCustomMessage(Map arg0){
//		return this.conversation.createSendCustomMessage(Map arg0);
//	}
//
//	public Message createSendCustomMessage(Map arg0, String arg1){
//		return this.conversation.createSendCustomMessage(Map arg0, String arg1);
//	}


}
